home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7398 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.9 KB

  1. Path: goanna.cs.rmit.EDU.AU!not-for-mail
  2. From: rav@goanna.cs.rmit.EDU.AU (++           robin)
  3. Newsgroups: comp.lang.pl1,comp.lang.c
  4. Subject: Re: PL/I and C
  5. Date: 26 Feb 1996 16:54:07 +1100
  6. Organization: Comp Sci, RMIT, Melbourne, Australia
  7. Message-ID: <4grhtv$s31@goanna.cs.rmit.EDU.AU>
  8. References: <4gh5ru$eng@goanna.cs.rmit.EDU.AU> <312CCEB2.4AB7@corp.dialog.com>
  9. NNTP-Posting-Host: goanna.cs.rmit.edu.au
  10. X-Newsreader: NN version 6.5.0 #0 (NOV)
  11.  
  12.     Paul Gorodyansky <paul_gorodyansky@corp.dialog.com> writes:
  13.  
  14.     >Mike Presseller <mpressel@research.westlaw.com> wrote:
  15.     >  > I am in the process of evaluating the development of Mainframe
  16.     >  > applications using C/370 and PLI under MVS. 
  17.  
  18.     >  For the jobs you mentioned: 
  19.     >    > text conversions, database maintenance and development,
  20.     >    > and other I/O intensive routines
  21.     >  PL/I is MUCH better (I am talking about mainframe):
  22.  
  23.     >  I. Text Processing.                         
  24.     >     ---------------
  25.     >        C does not have so extensive Text Processing built-in functions,
  26.     >     as PL/I does. Moreover, C has this STUPID limitation - a 'string'
  27.     >     in C it's a set of bytes with x'00' at the end ! But, we have
  28.     >     x'00' all over our source data ! It's the same symbol as any other,
  29.     >     there is nothing special in it. So, I HAD TO write myself ALL
  30.     >     string functions (sub-string, search,..) using BUFFERS, because I 
  31.     >     was not able to use C 'String' functions.  Obviously, functions
  32.     >     written by me are not so efficient as Built-in functions, 
  33.     >     so the productivity suffers.
  34.     >     Also, C does not have Variable Length strings.
  35.     >     Again, PL/I has BUILT-IN, effective string functions.
  36.  
  37. ---The basic operations of string-handling are done somewhat
  38. clumsily in C -- catenation is a simple infix operation
  39. in PL/I, but you must use a function in C, and then it
  40. catentates the second operand to the first.  Nothing like
  41. c = d || e;
  42. (And what happens when, in strcat(s1, s2), the sum of the lengths
  43. of s1 and s2 exceeds the declaration for s1?!?!?
  44.  
  45. ---again, for comparison, IF s1 > s2 THEN . . .  becomes
  46. strcmp(s1, s2) . . . which yields neg, 0, or pos . . .
  47. which leads to IF strcmp(s1, s2) > 0 . . .
  48. which is scarcely intuitive [shades of the arcane FORTRAN
  49. arithmetic IF].
  50.  
  51.    I'd agree with the statement about built-in functions.
  52. PL/I for AIX and OS/2 now have BIFs for searching for specific
  53. characters (SEARCH) either from the right or from the left,
  54. searching for the absence of specififc characters (VERIFY)
  55. from the right or left.
  56.  
  57.    Furthermore INDEX, SEARCH, SEARCHR, VERIFY and VERIFYR
  58. can start the search at any specified position (the three-
  59. argument versions).
  60.  
  61.    There are several functions for centering text, & trimming
  62. given characters from either or both ends of a string.
  63.  
  64.    And what happens when you actually w*a*n*t a zero byte in your
  65. C character string?
  66.  
  67.     >Paul Gorodyansky      mailto:paul_gorodyansky@corp.dialog.com
  68.